﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Main.aspx.vb" Inherits="examquestions.List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:PlaceHolder ID="ph_SuperUsers" runat="server">
   
    Welcome super user!
    
    </asp:PlaceHolder>

<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ExamQuestionsConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ExamQuestionsConnectionString.ProviderName %>" 
    SelectCommand="SELECT DISTINCT [tagBody] FROM [tag]"></asp:SqlDataSource>
     
    <!-- Worthy 1 -->
    <div class="page-header">
        <h2>Panels</h2>
      </div>
      <div class="row">
        <div class="col-sm-4">
          <div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">Tags</h3>
            </div>
            <div class="panel-body">
              <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2">
                <ItemTemplate>
                <a href="Default.aspx?tagBody=<%# Eval("tagBody")%>"><%# Eval("tagBody")%>  </a>
                </ItemTemplate>
              </asp:Repeater>
            </div>
          </div>

        </div><!-- /.col-sm-4 -->
        <div class="col-sm-4">
          <div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">Panel</h3>
            </div>
            <div class="panel-body">
              Content goes here
              </div>
          </div>
        </div><!-- /.col-sm-4 -->
        <div class="col-sm-4">
          <div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">Panel title</h3>
            </div>
            <div class="panel-body">
              Panel content
            </div>
          </div>
        </div><!-- /.col-sm-4 -->
      </div>

      <!-- questions -->
    <div class="page-header">
        <h2>All questions</h2>
      </div>
    <div class="table-responsive">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="questionID" 
        DataSourceID="SqlDataSource1" Width="100%" 
         CssClass="table table-striped table-hover table-bordered">
        <Columns>
            <asp:BoundField DataField="examTypeID" HeaderText="Exam type" 
                SortExpression="examTypeID" />
            <asp:BoundField DataField="examBoardID" HeaderText="Exam board" 
                SortExpression="examBoardID" />
            <asp:BoundField DataField="questionText" HeaderText="Question" 
                SortExpression="questionText" HtmlEncode="False" HtmlEncodeFormatString="False" />
            <asp:BoundField DataField="pointValue" HeaderText="Marks" 
                SortExpression="pointValue" />
            <asp:TemplateField HeaderText="Attachment">
            <ItemTemplate>
            <a href="Details.aspx?questionID=<%# Eval("questionID")%>">
            <asp:Image ID="imageRemove" runat="server" ImageUrl='<%# Eval("attachment")%>' Width="50px"/> 
            </a></ItemTemplate>
            </asp:TemplateField>
            <asp:HyperLinkField DataNavigateUrlFields="questionID" 
                DataNavigateUrlFormatString="Details.aspx?questionID={0}" 
                HeaderText="More info" Text="More info" />
        </Columns>
    </asp:GridView>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ExamQuestionsConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ExamQuestionsConnectionString.ProviderName %>" 
         CancelSelectOnNullParameter= "False">

                <SelectParameters>
            <asp:QueryStringParameter Name="tagBody" QueryStringField="tagBody" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    
    
    <br />
    <!-- Worthy 2 -->
    <div class="page-header">
        <h2>Panels</h2>
      </div>
      <div class="row">
        <div class="col-sm-4">
          <div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">Panel</h3>
            </div>
            <div class="panel-body">
              Content goes here
            </div>
          </div>

        </div><!-- /.col-sm-4 -->
        <div class="col-sm-4">
          <div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">Tweets</h3>
            </div>
            <div class="panel-body">
              <a class="twitter-timeline" href="https://twitter.com/iborganization" data-widget-id="419976148445978625">Tweets by @iborganization</a>
<script>    !function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + "://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } } (document, "script", "twitter-wjs");</script>
            </div>
          </div>
        </div><!-- /.col-sm-4 -->
        <div class="col-sm-4">
          <div class="panel panel-primary">
            <div class="panel-heading">
              <h3 class="panel-title">Panel title</h3>
            </div>
            <div class="panel-body">
              Panel content
            </div>
          </div>
        </div><!-- /.col-sm-4 -->
      </div>
    <br />
    <br />
    

</asp:Content>
